package com.yanqu.road.server.manger.cricket.skillhandler.startround.handler;

import com.yanqu.road.entity.enums.eSkillType;
import com.yanqu.road.pb.cricket.CricketProto;
import com.yanqu.road.server.gameplayer.module.cricket.battle.CricketGame;
import com.yanqu.road.server.gameplayer.module.cricket.model.BattleData;
import com.yanqu.road.server.gameplayer.module.cricket.model.SkillData;
import com.yanqu.road.server.manger.cricket.skillhandler.startround.CricketSkillStartRoundStrategy;

public class CricketSkill156Strategy implements CricketSkillStartRoundStrategy {

    /**
     * 技能处理-赤炎绫-战场持续被火焰覆盖，我方攻击{0}，对方攻击{1}。
     * @param cricketGame 本局对局对象
     * @param skillData 技能数据
     * @param action 我方
     * @param target 对方
     * @param roundId 第几回合
     * @param attackRoundBuilder 返回PB结构体
     * @return
     */
    @Override
    public boolean skillHandle(CricketGame cricketGame, SkillData skillData, BattleData action, BattleData target, int roundId, CricketProto.CricketAttackRound.Builder attackRoundBuilder) {
        if (cricketGame.getMaxRound() == 1) {
            //这里加这个，是为了给客户端显示用
            skillData.effectAmountInc();
            CricketProto.CricketBattleFrame.Builder battleFrameBuilder = cricketGame.newBattleFrameBuilder();
            battleFrameBuilder.setActionUserId(action.getUserId());
            battleFrameBuilder.setTargetUserId(target.getUserId());
            battleFrameBuilder.setSkillId(skillData.getSkillId());
            cricketGame.fillRemainHp(battleFrameBuilder);
            attackRoundBuilder.addAttack(battleFrameBuilder);
        }
        return false;
    }
}
